package com.hl.card.credit.service.remote;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hl.card.credit.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.LinkedHashMap;


@Service
public class UserReslove implements UserService{


    @Autowired
    private UserService userService;

    @Override
    public User getUserById(String userid) {
        LinkedHashMap map= (LinkedHashMap) userService.getUserById(userid);
        String  userStr=JSON.toJSONString(map);
        if(null!=userStr){
            return  JSONObject.parseObject(userStr, User.class);
        }
        return null;
    }

    @Override
    public User getUserByRegCode(String regCode) {
        LinkedHashMap map= (LinkedHashMap) userService.getUserByRegCode(regCode);
        String userStr=JSON.toJSONString(map);
        if(null!=userStr){
            return  JSONObject.parseObject(userStr, User.class);
        }
        return null;
    }


    @Override
    public Object updatePartial(User user) {
        userService.updatePartial(user);
        return null;
    }


}
